<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <title>确认支付</title>
    <link rel="stylesheet" type="text/css" href="css/base.css"/>
    <link rel="stylesheet" type="text/css" href="css/zhifu.css"/>
    <link rel="stylesheet" type="text/css" href="css/mui.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/loaders.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/loading.css"/>
	<link rel="stylesheet" href="/js/plugins/dialog/dialog.css"/>

    <script src="js/rem.js"></script>
	<script src="/js/jquery/jquery.min.js"></script>
	<script src="/js/bootstrap/js/bootstrap.min.js"></script>
	<script src="/js/plugins/jrender/jrender.js"></script>
	<script src="/js/plugins/dialog/dialog.min.js"></script>
	<script src="/js/common.js"></script>

	<script type="text/javascript">
		$(function(){
            var user = JSON.parse(sessionStorage.getItem("user"));
            var id = getParams().id;
            $(".loading").addClass("loader-chanage")
            $(".loading").fadeOut(300)
		//计算内容上下padding
			reContPadding({main:"#main",header:"#header",footer:"#footer"});
			function reContPadding(o){
				var main = o.main || "#main",
					header = o.header || null,
					footer = o.footer || null;
				var cont_pt = $(header).outerHeight(true),
					cont_pb = $(footer).outerHeight(true);
				$(main).css({paddingTop:cont_pt,paddingBottom:cont_pb});
			}

			//根据订单id查询对应的订单
            $.get("/order/"+id+"/indent", function (data) {
                console.log(data);
                $(".travels").renderValues(data, {
                    handle: function (ele, value) {
                        $(ele).attr("href", "/shop/zhifu.html?id=" + value);
                    }
                })
            });


			//确认支付
			$(".payment").click(function () {
				//发送ajax请求修改用户的订单,并扣除用户的相应积分
                $.ajax({
                    url: "/order/"+id+"/indent?state="+1+"&userId="+user.id,
                    type: "PUT",
                    success: function () {
                        window.location.href = "/shop/indent.html";
                    }
                })

            });
		});


	</script>
</head>
<!--loading页开始-->
<div class="loading">
	<div class="loader">
        <div class="loader-inner pacman">
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
        </div>
	</div>
</div>
<!--loading页结束-->
	<body>
		<header class="mui-bar mui-bar-nav report-header box-s" id="header">
			<a href="javascript:history.go(-1)"><i class="iconfont icon-fanhui fl"></i></a>
			<p>确认支付</p>
	    </header>
	    <div id="main" class="mui-clearfix contaniner sorder">	    	
	    	<div class="warning clearfloat box-s">
    			提示：请在24小时内完成在线支付，逾期将视为订单无效
    		</div>
    		<div class="odernum clearfloat travels">
    			<ul>
    				<li>您的订单号:</li><li render-html="orderNumber"></li>
    				<li>应付积分：<span render-html="integral" id="integration"></span></li>
    			</ul>
    		</div>
    		<!--<div class="pay-method clearfloat">-->
    			<!--<ul>-->
    				<!--<li>-->
    					<!--<div style="height: 1rem">-->
    						<!---->
	    					<!--<label>请输入支付密码：</label>-->
	    					<!--<input type="password" name="password">-->
    					<!--</div>-->
    				<!--</li>-->
    			<!--</ul>-->
    		<!--</div>-->

	    	<a class="address-add fl payment">
	     		确认支付
	     	</a>
	    </div>
	    
	</body>
</html>
